//some sidebar variables
@sidebar-bg:#F2F2F2;
@sidebar-border-right:#CCC;

@menu-active-color:#0B6CBC;
@menu-bg:#F9F9F9;
@menu-color:#585858;
@menu-focus-color:#1963AA;
@menu-hover-indicator:#3382AF;
@menu-subarrow-color:#666;
@menu-active-color:#0B6CBC;
@menu-open-bg:#FAFAFA;
@menu-active-bg:#FFF;

@submenu-border:#E5E5E5;
@submenu-bg:#FFF;
@submenu-item-color:#616161;
@submenu-item-border:#E4E4E4;
@submenu-item-hover:#4B88B7;
@submenu-item-active-icon:#C86139;

@submenu-dashed-border:#B1C9E0;


@menumin-btn-bg:#F3F3F3;
@menumin-btn-border:#E0E0E0;
@menumin-icon-color:#AAA;
@menumin-icon-border:#BBB;
@menumin-icon-bg:#FFF;
@menumin-bg:#F5F5F5;
@menumin-border:#CCC;
@menumin-text-border:#DDD;
@menumin-shadow:~"2px 1px 2px 0 rgba(0,0,0,0.2)";

@shortcuts-bg:#FAFAFA;
@shortcuts-border:#DDD;






#sidebar {
 width:@sidebar-width;
 position:absolute;
 margin-left:0;  margin-top:0;
 
 border-right:1px solid @sidebar-border-right;
 background-color:#FFF;
 
  &:before {/* the grey background of sidebar */

	 content:""; display:block;
	 width:@sidebar-width;
		
	 position:fixed; bottom:0px; top:0px;
	 z-index:-1;
		
	 background-color:@sidebar-bg;
	 border-right:1px solid @sidebar-border-right;
 }
 
 &.fixed {
	position:fixed;
	z-index:14;
 }
}



/* side navigation */
li [class^="icon-"], li [class*=" icon-"]{
 & , .nav-list & {
	width:auto;
 }
}

.nav-list {
 margin:0; padding:0;
 list-style:none;
}

.nav-list > li > a, .nav-list .nav-header {
 margin:0;
}

.nav-list > li {
 display:block;
 padding:0;
 margin:0;

 border:none;
 border-top:1px solid #FCFCFC;
 border-bottom:1px solid #E5E5E5;

 position:relative;

 &:first-child {
	border-top:none;
 }
}


.nav-list > li {
 .active_state_caret() {
	display:inline-block;
	content:"";
	 
	position:absolute !important;
	right:0; top:4px;

	border:8px solid transparent;
	border-width:14px 10px;
	border-right-color:@menu-active-color;
 }


 > a {
	 display:block;
	 height:38px; line-height:36px;

	 padding:0 16px 0 7px; 
	 background-color:@menu-bg;

	 color:@menu-color;
	 text-shadow:none !important;

	 font-size:13px;
	 text-decoration:none;

	 > [class*="icon-"]:first-child {
		display:inline-block;
		vertical-align:middle;

		min-width:30px;
		text-align:center;

		font-size:18px;
		font-weight:normal;
	 }
	 
	 &:focus {
		background-color:@menu-bg;
		color:@menu-focus-color;
	 }
	 
	 &:hover  {
		background-color:#FFF;
		color:@menu-focus-color;
		&:before {
			display:block; content:"";
			position:absolute;
			top:-1px; bottom:0; left:0;
			width:3px; max-width:3px; overflow:hidden;
			background-color:@menu-hover-indicator;
		}
	 }

	/* the submenu indicator arrow */
	.arrow {
	   display:inline-block;
	   width:14px !important; height:14px;
	   line-height:14px;
	 
	   text-shadow:none;
	   font-size:18px;
	 
	   position:absolute;
	   right:9px; top:11px;
	 
	   padding:0;
	   color:@menu-subarrow-color;
	}

 }
 a:hover > .arrow , &.active > a  > .arrow , &.open > a > .arrow  {
	color:@menu-focus-color;
 }



 &.separator {
	 height:3px;
	 background-color:transparent;
	 position:static;
	 margin:1px 0;

	 box-shadow:none;
 }

 /* menu active/open states */
 &.open > a {
	background-color:@menu-open-bg;
	color:@menu-focus-color;
 }

 &.active {
  background-color:@menu-active-bg;
   > a
  {
	 & , &:hover, &:focus, &:active {
		 background-color:@menu-active-bg;
		 color:@menu-active-color;
		 font-weight:bold;
		 font-size:13px;
	 }
	 
	 > [class*="icon-"] {
		font-weight:normal;
     }
	
	 &:hover:before {/* no left side menu item border on active state */
		display:none;
	 }
	 

	 &:after {
		.active_state_caret();
	 }
	 &.dropdown-toggle:after {
		border-width:12px 7px;
		top:6px;
	}
  }
  &.no-active-child > {
	> a:after {/* show caret for active menu item with childs which is not open(i.e. submenu item is not active) */
		display:inline-block !important;
	}
  }
  //////
  &.open > a:after {/* no caret for open menu item */ //we put this after .active > a:after to override it
	display:none;
  }
  //////
  
  &:after {/* the border on right of active item */
	display:inline-block; content:"";
	position:absolute;
	right:-2px; top:-1px; bottom:0;
	border-right:2px solid @menu-active-color;
  }
 }









 /* submenu */
 &.open {
  border-bottom-color:@submenu-border;
 }

 &.active.open > .submenu > li.active > a:after {
  .active_state_caret();
  top:2px;
 }

 &.active .submenu {
  display:block;
 }
 .submenu {
   display:none;
   list-style:none;
   margin:0; padding:0;

   position:relative;
   background-color:@submenu-bg;
 
   border-top:1px solid @submenu-border;


   > li {
	 margin-left:0;
	 position:relative;
	 
	 > a {
		 display:block;
		 position:relative;
		 color:@submenu-item-color;

		 padding:7px 0 8px 37px;
		 margin:0;
		 
		 border-bottom:1px dotted @submenu-item-border;
		 &:focus {
			text-decoration:none;
		 }
		 &:hover{
			text-decoration:none;
			color:@submenu-item-hover;
		}
	 }
	
	 &:last-child > a {
		border-bottom:none;
	 }
	 &:first-child > a {
		border-top:1px solid #FAFAFA;
	 }
	 &.active > a {
		color:@menu-active-color;
	 }



	 /* tree like menu */
	 /* the horizontal dashed line */
	 &:before {
		content:""; display:inline-block;		
		position:absolute;
		
		width:9px;		 
		left:21px; top:17px;
		border-top:1px dashed @submenu-dashed-border;
	 }
	/* the vertical dashed line */
	&:after {
		content:""; display:inline-block;
		position:absolute;
		 
		top:0; bottom:0; left:18px; width:0px;
		border-left:1px dashed @submenu-dashed-border;
	}
	
	
	
	/* optional icon before each item */
	a > [class*="icon-"]:first-child {
		display:none;

		font-size:12px; font-weight:normal;
		width:22px; height:16px; line-height:16px; text-align:center;
		position:absolute; left:8px; top:10px; z-index:1;

		background-color:#FFF;
	}
	&.active > a > [class*="icon-"]:first-child,
	&:hover > a > [class*="icon-"]:first-child {
		display:inline-block;
	}
	&.active > a > [class*="icon-"]:first-child {
		color:@submenu-item-active-icon;
	}
	
	
	
  }
 }//end of submenu

 
}//end of .nav-list > li 











/* side menu minimizer icon */
#sidebar-collapse  {
 border-bottom:1px solid @menumin-btn-border;
 background-color:@menumin-btn-bg;
 
 text-align:center;
 padding:3px 0;
 
 position:relative;
 
 
 > [class*="icon-"]{
	 display:inline-block;
	 
	 cursor:pointer;
	 font-size:14px;
	 color:@menumin-icon-color;
	 
	 border:1px solid @menumin-icon-border;
	 padding:0 5px;
	 line-height:18px;
	 
	 border-radius:16px;

	 background-color:@menumin-icon-bg;
	 position:relative;
 }
 
 &:before {
	content:"";
	display:inline-block;
	 
	height:0;
	border-top:1px solid @menumin-btn-border; 
	position:absolute;
	left:15px; right:15px; top:13px;
 }

}



/* sidebar shortcuts icon */
#sidebar-shortcuts {
 background-color:@shortcuts-bg;
 border-bottom:1px solid @shortcuts-border;
 text-align:center;
 
 line-height:37px; max-height:40px;
 margin-bottom:0;
}
#sidebar-shortcuts-large {
 padding-bottom:4px;
 > .btn > [class*="icon-"] { font-size:110%; }
}
#sidebar-shortcuts-mini {
 display:none;
 font-size:0;
 width:42px;
 line-height:18px;
 padding-top:2px; padding-bottom:2px;
 
 background-color:@submenu-bg;
 
  > .btn{
	 border-width:0 !important;
	 font-size:0;
	 line-height:0;
	 padding:8px !important;
	 margin:0 1px;
	 
	 border-radius:0 !important;
	 opacity:0.85;
  }
}









/* minimized side menu*/
#sidebar.menu-min {
	width:@sidebar-min-width;
	&:before {
		width:@sidebar-min-width;
	}
	+ #main-content {
		margin-left:(@sidebar-min-width + 1);
		#breadcrumbs.fixed { left:(@sidebar-min-width + 1); }
	}
}

.menu-min .nav-list > li {
  > a {
	position:relative;
	 > span {
		display:none;
		
		position:absolute;
		left:(@sidebar-min-width - 1); top:-2px;
		width:(@sidebar-width - 31); height:39px;
		
		line-height:38px;
		background-color:@menumin-bg;
		z-index:121;
		
		box-shadow:@menumin-shadow;
		border:1px solid @menumin-border;
		
		padding-left:12px;
    }
	&.dropdown-toggle > span {
		box-shadow:none;
		border:none;
		top:-1px; left:@sidebar-min-width;
		width:(@sidebar-width - 26);
		border-bottom:1px solid @menumin-text-border;
	}
	.arrow {
		display:none;
    }
	
	&:hover:before {/* the right side border on hover */
		width:2px;
	}
  }
 
 &:hover > a {
	color:@menu-focus-color;
	> span {
		display:block;
   }
 }
 &.active > a > span {
	border-left-color:@menu-focus-color;
 }
 &.open > a  {
	background-color:@menu-open-bg;
	color:@menu-color;
 }
 &.open.active > a  {
	background-color:@menu-active-bg;
 }
 &.open:hover > a {
	color:@menu-focus-color;
 }
 
 &.active > a:after  { /* the caret */
	border-width:10px 6px;
	top:8px;
 }
 &.active.open > a:after {
	display:block;
 }
 &.active.open > .submenu > li.active > a:after {
	display:none;
 }

 
 
 > ul.submenu {
	background:@submenu-bg;
	position:absolute; z-index:120;
	left:(@sidebar-min-width - 1); top:-2px;

	width:(@sidebar-width - 14);
	border:1px solid @menumin-border;

	box-shadow:@menumin-shadow;

	padding-top:40px;
	padding-bottom:2px;

	display:none !important;
	
	
	 
	li {
	  /* hide the tree like submenu in minimized mode */
	  &:before, &:after {
		display:none;
	  }
	  
	  > a {
		border-left:none;
		margin-left:0;
		padding-left:24px;
		> [class*="icon-"]:first-child {
			width:16px;
		}
	  }
	  
	  &.active , &:hover {
		> a > [class*="icon-"]:first-child {
		  left:7px;
		}
	   }
	}
 }

 &:hover > ul.submenu {
	display:block !important;
 }
 &.active > ul.submenu {
	border-left-color:@menu-focus-color;
 }


}


.menu-min { /* minimized sidebar shortcuts */
  #sidebar-shortcuts {
	position:relative;
  }
  #sidebar-shortcuts-mini {
	display:block;
  }
  
  #sidebar-shortcuts-large {
	display:none;
	position:absolute; left:@sidebar-min-width; top:-1px;
	width:(@sidebar-width - 14);
	z-index:20;
	background-color:@submenu-bg;
	box-shadow:@menumin-shadow;
	border:1px solid @menumin-border;
	padding:0 2px 3px;
  }
  #sidebar-shortcuts:hover #sidebar-shortcuts-large{
	display:block;
  }

  #sidebar-collapse { /* minimized collapse button */
	&:before {
		left:5px; right:5px;
	}
	> [class*="icon-"] {
		font-size:13px;
		padding:0 4px;
		line-height:15px;

		border-width:1px;
		border-color:darken(@menumin-icon-border, 5%);
	}
  }
}




/* side menu toggler in mobile view */
#menu-toggler { 
 display:none;
}


